package com.dx.context;

import com.dx.entity.bo.Employee;

public class ContextHolder {
    //TODO 完成Context类
    private  static ThreadLocal<Employee> context=new ThreadLocal<>();
    public static ThreadLocal<String> jwtToken=new ThreadLocal<>();
    public static void setUser(Employee e){
        context.set(e);
    }
    public static Employee getUser(){
        return context.get();
    }
    public static void setJwtToken(String token){
        jwtToken.set(token);
    }
    public static String getJwtToken(){
        return jwtToken.get();
    }
    public static void  removeUser(){
        context.remove();
    }
    public static void removeJwtToken(){
        jwtToken.remove();
    }
}
